<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>

  <div class="cf">
    <a class="btn" href="{:U('brandEdit')}">新 增</a>
    <a class="btn" href="{:U('brand')}">刷 新 <span style="font-size:12px;font-weight:normal">(清空搜索条件)</span></a>
    <button class="btn ajax-post confirm" target-form="ids" url="/Admin/Item/delBrand.html">删除</button>
    <!-- 高级搜索 -->
    <form id="J_search_form" action="{:U('brand')}" method="GET">
    <div class="search-form fr cf">
      <div class="fl">
         <select name="cid">
           <option value="0">全部分类</option>
           <volist name="class" id="vo">
             <option value="{$vo.id}" >{$vo.name}</option>
           </volist>
         </select>
      </div>
      <div class="fl">
         <select name="status">
           <option value="-1">请选择状态</option>
           <option value="0">待审核</option>
           <option value="1">已审核</option>
         </select>
      </div>
      <div class="sleft">
        <input type="text" name="name" class="search-input" value="{:I('name')}" placeholder="请输入品牌名称">
        <a class="sch-btn" href="javascript:;" id="J_search" url="__SELF__"><i class="btn-search"></i></a>
      </div>
    </div>
    </form>
  </div>

  <div class="data-table table-striped">
    <form class="ids">
      <table>
        <thead>
          <tr>
            <th class="row-selected" width="50">
              <input class="checkbox check-all" type="checkbox">
            </th>
            <th>品牌名称</th>
            <th>所属分类</th>
            <th>品牌LOGO</th>
            <th>是否推荐</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
        <notempty name="lists">
          <volist name="lists" id="vo">
            <tr>
              <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$vo.id}"></td>
              <td>{$vo.name}</td>
              <td>{:get_short($class[$vo['cid']]['name'],10)}</td>
              <td><img src="{:get_image_thumb(get_cover($vo['pic'], 'path'), 150, 50)}" /></td>
              <td>{$vo['recommend'] ? '是' : '否'}</td>
              <td>{$vo['status_text']}</td>
              <td>
                <php>if($vo['status'] == 0){</php>
                    <a title="编辑" href="{:U('brandEdit?id='.$vo['id'])}">[编辑]</a>
                    <a class="confirm ajax-get" title="删除" href="{:U('delBrand?ids='.$vo['id'])}">[删除]</a>
                <php>}else{</php>
                    <a title="编辑" class="disabled">[编辑]</a>
                    <a title="删除" class="disabled">[删除]</a>
                <php>}</php>
              </td>
            </tr>
          </volist>
        <else/>
          <td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
        </notempty>
        </tbody>
      </table>
    </form>
    <!-- 分页 -->
    <div class="page">
      {$_page}
    </div>
  </div>
</block>

<block name="script">
  <script type="text/javascript">
    $(function() {
      //导航高亮
      highlight_subnav("{:U('brand')}");
      Core.setValue("cid", {:I('cid')});
      Core.setValue("status", {:I('status')});
    });
  </script>
</block>